//
//  ResultViewController.m
//  TheRoadAD
//
//  Created by baixue on 16/9/10.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "ResultViewController.h"
#import "ChooseCell.h"

@interface ResultViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic, strong) UITableView *tableView;

@end

#define IMGPICT @[@"jingxuan1",@"jingxuan2",@"jingxuan3"]
@implementation ResultViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self setTableView];
}

-(void)setTableView{
    _tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:0];
    [self.view addSubview:_tableView];
    _tableView.delegate = self;
    _tableView.dataSource = self;
    
    //注册
    [_tableView registerNib:[UINib nibWithNibName:@"ChooseCell" bundle:nil] forCellReuseIdentifier:@"ChooseCell"];
}


-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return 3;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    ChooseCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ChooseCell"];
    cell.pictImg.image = [UIImage imageNamed:IMGPICT[indexPath.row]];
    return cell;
}

-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 270 * Screen_Width/319;
}

@end
